#include "valva_drive.h"
//const uint16_t medela_knead_mode_pump_hold_set[9] = {4200,4800,5500,6100,6700,7300,7900,8500,9000};       
const uint16_t medela_knead_mode_pump_hold_set[9] = {4200,4800,5500,6100,6700,7300,7900,8500,9000};      
//��ʼ50mS,����50mS
const uint16_t medela_knead_mode_on_set[9] = {250,250,250,260,330,330,350,360,360};
const uint16_t medela_knead_mode_off_set[9] = {490,490,490,500,510,530,540,560,620};

const uint16_t medela_knead_mode_pump_hold_tim_set[9] = {
                                                KNEAD_PUMP_HOLD_TIM_1,
                                                KNEAD_PUMP_HOLD_TIM_2,
                                                KNEAD_PUMP_HOLD_TIM_3,
                                                KNEAD_PUMP_HOLD_TIM_4,
                                                KNEAD_PUMP_HOLD_TIM_5,
                                                KNEAD_PUMP_HOLD_TIM_6,
                                                KNEAD_PUMP_HOLD_TIM_7,
                                                KNEAD_PUMP_HOLD_TIM_8,
                                                KNEAD_PUMP_HOLD_TIM_9};
// const uint16_t medela_suckle_mode_on_set[9] = {300,300,400,400,450,450,620,700,800};
// const uint16_t medela_suckle_mode_off_set[9] = {820,930,1040,1130,1230,1350,1670,1820,2060};

//const uint16_t medela_suckle_mode_on_set[9] = {300,300,400,400,450,450,650,750,3800};
const uint16_t medela_suckle_mode_on_set[9] = {260,280,300,320,340,400,450,500,600};
const uint16_t medela_suckle_mode_off_set[9] = {630,720,820,940,1100,1220,1400,1670,1800};


const uint16_t medela_suckle_mode_pump_start_tim_set[9] = {  
                                                SUCKLE_PUMP_START_TIM_1,
                                                SUCKLE_PUMP_START_TIM_2,
                                                SUCKLE_PUMP_START_TIM_3,
                                                SUCKLE_PUMP_START_TIM_4,
                                                SUCKLE_PUMP_START_TIM_5,
                                                SUCKLE_PUMP_START_TIM_6,
                                                SUCKLE_PUMP_START_TIM_7,
                                                SUCKLE_PUMP_START_TIM_8,
                                                SUCKLE_PUMP_START_TIM_9};

const uint16_t medela_suckle_mode_pump_hold_set[9] =  {5000,5500,6000,6500,7000,7600,7800,8500,9200}; 
const uint16_t medela_suckle_mode_pump_hold_tim_set[9] = {  
                                                SUCKLE_PUMP_HOLD_TIM_1,
                                                SUCKLE_PUMP_HOLD_TIM_2,
                                                SUCKLE_PUMP_HOLD_TIM_3,
                                                SUCKLE_PUMP_HOLD_TIM_4,
                                                SUCKLE_PUMP_HOLD_TIM_5,
                                                SUCKLE_PUMP_HOLD_TIM_6,
                                                SUCKLE_PUMP_HOLD_TIM_7,
                                                SUCKLE_PUMP_HOLD_TIM_8,
                                                SUCKLE_PUMP_HOLD_TIM_9};

const uint16_t medela_suckle_mode_pump_start_set[5] = {4500,5000,5300,5500,6000};

const uint16_t medela_knead_mode_pump_start_set[5] = {5500,6000,6500,7000,7200};
					
void mode_select(void *pPayload)
{
    breast_output_msg_t* payload;

    payload = (breast_output_msg_t*)pPayload;
	switch(payload->packet.mode_gether) 
    {
        case KNEAD_MODE:
        {   
            payload->pValve_on = medela_knead_mode_on_set;
			payload->pValve_off = medela_knead_mode_off_set;
            payload->pPump_hold = medela_knead_mode_pump_hold_set;
            payload->pPump_tim_hold = medela_knead_mode_pump_hold_tim_set;
            payload->pPump_tim_start = NULL;
           //payload->pPump_tim_stage_start = NULL;
            payload->pPump_start = medela_knead_mode_pump_start_set;
            break;
        }

        case SUCKLE_MODE: 
        {
            payload->pValve_on = medela_suckle_mode_on_set;
            payload->pValve_off = medela_suckle_mode_off_set;
            payload->pPump_hold = medela_suckle_mode_pump_hold_set;
            payload->pPump_tim_hold = medela_suckle_mode_pump_hold_tim_set;
            payload->pPump_tim_start = medela_suckle_mode_pump_start_tim_set;
            //payload->pPump_tim_stage_start = medela_suckle_mode_pump_start_stage_tim_set;
            payload->pPump_start = medela_suckle_mode_pump_start_set;
            break;
        }
       
        case STIMULATE_MODE: 
        {
            break;
        }
        
        case BIONIC_MODE: { break; }
    }
}